/*
 * Created on Wed Oct 11 2017
 * Copyright (c) 2017 jianglinjie
 */
'use strict';
import RegisterService from '../register';
import CaptchaService from '../captcha';
import * as TestConst from './TestConst';
import * as CaptchaBusiness from '../../constants/CaptchaBusiness';

beforeAll(async () => {
  try {
    await RegisterService.registerWithUserName(
      TestConst.USER_NAME, 
      TestConst.USER_NAME_PWD
    );
    let captchaResult = await CaptchaService.request({
      phone: TestConst.PHONE,
      business: CaptchaBusiness.REGISTER
    });
    await RegisterService.registerWithPhone(
      TestConst.PHONE, 
      TestConst.PHONE_PWD, 
      captchaResult.captcha);
  } catch (error) {
    //ignore
  }
});

//加载具体测试
import './auth';
import './register';